﻿'OutStandingIssues: Finir les GET/SET pour les DBNull.Value
'depricated....
'for reference only B.Desjardins 2014-07-15
Namespace PL.CRMSDK
    Public Class SalesOrder
        Private _dataRow As DataRow
        Public Sub New(ByVal dataRow As DataRow)
            Me.DataRow = dataRow
        End Sub
        Public Property SalesOrderId() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("SalesOrderId")), Nothing, Me.DataRow("SalesOrderId"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("SalesOrderId") = value
            End Set
        End Property
        Public Property CustomerId_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("CustomerId_FK")), Nothing, Me.DataRow("CustomerId_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("CustomerId_FK") = value
            End Set
        End Property
        Public Property EmplID_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("EmplID_FK")), Nothing, Me.DataRow("EmplID_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("EmplID_FK") = value
            End Set
        End Property
        Public Property PaymentTermID_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("PaymentTermID_FK")), Nothing, Me.DataRow("PaymentTermID_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("PaymentTermID_FK") = value
            End Set
        End Property
        Public Property IncotermId_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("IncotermId_FK")), Nothing, Me.DataRow("IncotermId_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("IncotermId_FK") = value
            End Set
        End Property
        Public Property SalesOrderCategoryId_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("SalesOrderCategoryId_FK")), Nothing, Me.DataRow("SalesOrderCategoryId_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("SalesOrderCategoryId_FK") = value
            End Set
        End Property

        Public Property SalesOrderTypeId_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("SalesOrderTypeId_FK")), Nothing, Me.DataRow("SalesOrderTypeId_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("SalesOrderTypeId_FK") = value
            End Set
        End Property
        Public Property SalesOrderClassId_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("SalesOrderClassId_FK")), Nothing, Me.DataRow("SalesOrderClassId_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("SalesOrderClassId_FK") = value
            End Set
        End Property
        Public Property SalesOrderGroupId_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("SalesOrderGroupId_FK")), Nothing, Me.DataRow("SalesOrderGroupId_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("SalesOrderGroupId_FK") = value
            End Set
        End Property
        Public Property ShippingMethodID_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("ShippingMethodID_FK")), Nothing, Me.DataRow("ShippingMethodID_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("ShippingMethodID_FK") = value
            End Set
        End Property
        Public Property ShipViaID_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipViaID_FK")), Nothing, Me.DataRow("ShipViaID_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("ShipViaID_FK") = value
            End Set
        End Property
        Public Property ShipToId_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipToId_FK")), Nothing, Me.DataRow("ShipToId_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("ShipToId_FK") = value
            End Set
        End Property
        Public Property CurrencyId_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("CurrencyId_FK")), Nothing, Me.DataRow("CurrencyId_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("CurrencyId_FK") = value
            End Set
        End Property
        Public Property StatusID_FK() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("StatusID_FK")), Nothing, Me.DataRow("StatusID_FK"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("StatusID_FK") = value
            End Set
        End Property
        Public Property OrderCd() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("OrderCd")), Nothing, Me.DataRow("OrderCd"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("OrderCd") = value
            End Set
        End Property
        Public Property OrderNo() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("OrderNo")), Nothing, Me.DataRow("OrderNo"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("OrderNo") = value
            End Set
        End Property
        Public Property InvoiceNo() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("InvoiceNo")), Nothing, Me.DataRow("InvoiceNo"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("InvoiceNo") = value
            End Set
        End Property
        Public Property OrderedBy() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("OrderedBy")), Nothing, Me.DataRow("OrderedBy"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("OrderedBy") = value
            End Set
        End Property
        Public Property PurchaseOrderNumber() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("PurchaseOrderNumber")), Nothing, Me.DataRow("PurchaseOrderNumber"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("PurchaseOrderNumber") = value
            End Set
        End Property
        Public Property ShipName() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipName")), Nothing, Me.DataRow("ShipName"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("ShipName") = value
            End Set
        End Property
        Public Property ShipAddress() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipAddress")), Nothing, Me.DataRow("ShipAddress"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("ShipAddress") = value
            End Set
        End Property
        Public Property ShipCity() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipCity")), Nothing, Me.DataRow("ShipCity"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("ShipCity") = value
            End Set
        End Property
        Public Property ShipStateOrProvince() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipStateOrProvince")), Nothing, Me.DataRow("ShipStateOrProvince"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("ShipStateOrProvince") = value
            End Set
        End Property
        Public Property ShipPostalCode() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipPostalCode")), Nothing, Me.DataRow("ShipPostalCode"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("ShipPostalCode") = value
            End Set
        End Property
        Public Property ShipCountry() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipCountry")), Nothing, Me.DataRow("ShipCountry"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("ShipCountry") = value
            End Set
        End Property
        Public Property ShipPhoneNumber() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipPhoneNumber")), Nothing, Me.DataRow("ShipPhoneNumber"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("ShipPhoneNumber") = value
            End Set
        End Property
        Public Property SavedInvoiceDoc() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("SavedInvoiceDoc")), Nothing, Me.DataRow("SavedInvoiceDoc"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("SavedInvoiceDoc") = value
            End Set
        End Property
        Public Property Comment() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("Comment")), Nothing, Me.DataRow("Comment"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("Comment") = value
            End Set
        End Property
        Public Property Crtd_UId() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("Crtd_UId")), Nothing, Me.DataRow("Crtd_UId"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("Crtd_UId") = value
            End Set
        End Property
        Public Property LUpd_UId() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("LUpd_UId")), Nothing, Me.DataRow("LUpd_UId"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("LUpd_UId") = value
            End Set
        End Property
        Public Property Issue() As Integer
            Get
                Return IIf(IsDBNull(Me.DataRow("ISSUE")), Nothing, Me.DataRow("ISSUE"))
            End Get
            Set(ByVal value As Integer)
                Me.DataRow("ISSUE") = value
            End Set
        End Property
        Public Property CustomerCd() As Integer?
            Get
                Return IIf(IsDBNull(Me.DataRow("CustomerCd")), Nothing, Me.DataRow("CustomerCd"))
            End Get
            Set(ByVal value As Integer?)
                Me.DataRow("CustomerCd") = value
            End Set
        End Property
        Public Property OrderDate() As Date?
            Get
                Return IIf(IsDBNull(Me.DataRow("OrderDate")), Nothing, Me.DataRow("OrderDate"))
            End Get
            Set(ByVal value As Date?)
                Me.DataRow("OrderDate") = IIf(value Is Nothing, DBNull.Value, value)
            End Set
        End Property
        Public Property InvoiceDate() As Date?
            Get
                Return IIf(IsDBNull(Me.DataRow("InvoiceDate")), Nothing, Me.DataRow("InvoiceDate"))
            End Get
            Set(ByVal value As Date?)
                Me.DataRow("InvoiceDate") = IIf(value Is Nothing, DBNull.Value, value)
            End Set
        End Property

        Public Property ShipDate() As Date?
            Get
                Return IIf(IsDBNull(Me.DataRow("ShipDate")), Nothing, Me.DataRow("ShipDate"))
            End Get
            Set(ByVal value As Date?)
                Me.DataRow("ShipDate") = IIf(value Is Nothing, DBNull.Value, value)
            End Set
        End Property

        Public Property Crtd_DT() As Date?
            Get
                Return IIf(IsDBNull(Me.DataRow("Crtd_DT")), Nothing, Me.DataRow("Crtd_DT"))
            End Get
            Set(ByVal value As Date?)
                Me.DataRow("Crtd_DT") = IIf(value Is Nothing, DBNull.Value, value)
            End Set
        End Property
        Public Property LUpd_DT() As Date?
            Get
                Return IIf(IsDBNull(Me.DataRow("LUpd_DT")), Nothing, Me.DataRow("LUpd_DT"))
            End Get
            Set(ByVal value As Date?)
                Me.DataRow("LUpd_DT") = IIf(value Is Nothing, DBNull.Value, value)
            End Set
        End Property
        Public Property FreightCharge() As Decimal?
            Get
                Return IIf(IsDBNull(Me.DataRow("FreightCharge")), Nothing, Me.DataRow("FreightCharge"))
            End Get
            Set(ByVal value As Decimal?)
                Me.DataRow("FreightCharge") = value
            End Set
        End Property

        Public Property TPS_SalesTaxRate() As Decimal?
            Get
                Return IIf(IsDBNull(Me.DataRow("TPS_SalesTaxRate")), Nothing, Me.DataRow("TPS_SalesTaxRate"))
            End Get
            Set(ByVal value As Decimal?)
                Me.DataRow("TPS_SalesTaxRate") = value
            End Set
        End Property

        Public Property TVQ_SalesTaxRate() As Decimal?
            Get
                Return IIf(IsDBNull(Me.DataRow("TVQ_SalesTaxRate")), Nothing, Me.DataRow("TVQ_SalesTaxRate"))
            End Get
            Set(ByVal value As Decimal?)
                Me.DataRow("TVQ_SalesTaxRate") = value
            End Set
        End Property

        Public Property OrderRate() As Decimal?
            Get
                Return IIf(IsDBNull(Me.DataRow("OrderRate")), Nothing, Me.DataRow("OrderRate"))
            End Get
            Set(ByVal value As Decimal?)
                Me.DataRow("OrderRate") = value
            End Set
        End Property
        Public Property RecordVersion() As Byte()
            Get
                Return IIf(IsDBNull(Me.DataRow("RecordVersion")), Nothing, Me.DataRow("RecordVersion"))
            End Get
            Set(ByVal value As Byte())
                Me.DataRow("RecordVersion") = value
            End Set
        End Property
        Public Property DataRow() As DataRow
            Get
                Return _dataRow
            End Get
            Set(ByVal value As DataRow)
                _dataRow = value
            End Set
        End Property
    End Class
End Namespace